# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=glue
pkgver=380.8703380
pkgrel=9
groups=('blackarch' 'blackarch-automation')
pkgdesc='A framework for running a series of tools.'
arch=('any')
url='https://github.com/OWASP/glue'
license=('APACHE')
depends=('ruby' 'ruby-bundler' 'libxslt')
makedepends=('git')
options=(!strip)
source=("git+https://github.com/OWASP/$pkgname.git")
sha512sums=('SKIP')
install="$pkgname.install"

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec ruby /usr/share/$pkgname/bin/$pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

